home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-05-23 | 42.0 KB | 1,041 lines |
- ;PC Pursuit: VERSAdial, Version 1.1, by Allen Brunson, David Rhoten, and Gizmo
- ;(C) 1987, Allen Brunson
-
- ;========== VARIABLE TABLE ==========
- ;VERSA is consistent about its use of variables. Here is a table that briefly
- ;describes the use of each. Note that, from VERSA's point of view, the
- ;macros stored in VERSA.KEY are also variables, so they are included here as
- ;well.
-
- ;NORMAL VARIABLES:
- ;S0 Stores the user's current level (1 = offline, 2 = local, 3 = remote)
- ;S1 Area code to be dialed
- ;S2 BBS phone number to be dialed
- ;S3 Cleared for future use
- ;S4 Cleared for future use
- ;S5 Cleared for future use
- ;S6 *Extended Menus ("ON" or "OFF")
- ;S7 Command file to execute upon connect
- ;S8 RGETs
- ;S9 Secondary RGETs, user input, parameter passing from menus
-
- ;MACROS IN VERSA.KEY:
- ;A7 *Local Telenet number <CR>
- ;A8 *PC-P baud rate
- ;A9 *Your user ID <CR>
- ;A0 *Your password <CR>
-
- ;NOTE: Variables with an asterisk are set once at the beginning of execution
- ;and should NOT be changed at any time. Alt-1 through Alt-6 in VERSA.KEY
- ;can be set to whatever you wish.
-
-
-
- ;========== RE_ENTRY ==========
- ;This first section of the command file handles re-entry from one of the
- ;menus, if this has occurred. S9 is used as the parameter variable. If one
- ;of the menus has set S9 to "ACTIVE", then a number has been properly
- ;assigned to S2, and dialing can proceed. If the user entered "D", "E", or
- ;"G" in the menu, those values are left alone and passed directly to here.
- ;If VERSA is starting fresh, then S9 will be null, and execution will begin
- ;as usual. If S9 is set to anything else, VERSA will terminate with an
- ;error.
-
- RE_ENTRY:
- SWITCH S9 ;Decision based on S9
- CASE "_NULL" ;If S9 has no value . . .
- GOTO BEGIN ;Begin execution normally
- ENDCASE
- CASE "D" ;If S9 = "D" (Disconnect) . . .
- GOTO PCPOFF ;PCPOFF will take care of disconnection
- ENDCASE
- CASE "E" ;If S9 = "E" (Exit) . . .
- CLEAR ;Clear the screen . . .
- GOTO VERSAOFF ;And exit
- ENDCASE
- CASE "G" ;If S9 = "G" (Go back to city menu) . . .
- FIND S0 "3" ;Look for "3" in S0
- IF FOUND ;If found, level = 3 . . .
- GOSUB DISC3 ;So disconnect from remote city
- ENDIF
- GOTO CITYCHOICE ;Then, select a new city
- ENDCASE
- CASE "ACTIVE" ;If S9 equals "ACTIVE" . . .
- GOTO GOLEVEL ;Then begin dialing
- ENDCASE
- DEFAULT ;If S9 equals anything else . . .
- CLEAR ;Clear the screen
- LOCATE 11,20 ;Locate cursor for message . . .
- MESSAGE "Parameter error from menu command file."
- LOCATE 14,0 ;Locate cursor for VERSAOFF message
- GOTO VERSAOFF ;And terminate
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== BEGIN ==========
- ;This section of the command file sets up some defaults. If you want
- ;to turn the extended menus off, this is the section to change. After
- ;the defaults are set, this section jumps past the subroutines and
- ;dialing routines to the real beginning of the code, TITLE.
-
- BEGIN:
- SET CR_IN CR ;Make sure LFs aren't added to incoming <CR>s
- SET CR_OUT CR ;Ditto for outgoing <CR>s
- SET PARITY EVEN ;Parity and databits must be set to . . .
- SET DATABITS 7 ;even and 7 for communicating with Telenet
- SET DUPLEX FULL ;Just in case you were at HALF
- SET BAUDRATE 1200 ;Baud rate of YOUR modem
- ASSIGN S6 "ON" ;Extended menus (ON or OFF)
- MLOAD "VERSA.KEY" ;Load in user information
- GOTO TITLE ;Go to beginning of code
-
-
-
- ;========== SUBROUTINES ==========
- ;We call these "subroutines," but most of them are not, in the truest sense
- ;of the word, because they do not all end in a RETURN. They are placed here
- ;near the top of the command file so that they will be found quickly as
- ;ProComm searches for their labels.
-
-
- ;CITYREDIAL is done repeatedly if the first attempt to connect to a remote
- ;city fails and the user opts to redial. This subroutine will repeat until
- ;a connection with the remote city is made; control will then pass to
- ;PORTSET, which will configure the remote modem.
-
- CITYREDIAL:
- CLEAR ;Clear screen
- TRANSMIT "C DIAL" ;Beginning of city dial command
- TRANSMIT S1 ;Area code
- MACRO 8 ;PCP baud rate
- MACRO 9 ;User ID
- WAITFOR "=" ;Wait for "PASSWORD ="
- MACRO 0 ;User password
- RGET S8 ;Get first <CR>
- RGET S8 ;Get second <CR>
- RGET S8 ;Get message from Telenet
- FIND S8 "CONNECTED" ;Look for "CONNECTED" in S8
- IF FOUND ;If "CONNECTED" is in S8,
- MESSAGE "^G" ;Sound the bell, because . . .
- GOTO PORTSET ;City is connected; Go to PORTSET
- ENDIF
- GOTO CITYREDIAL ;If not found, loop back to CITYREDIAL
-
-
- ;BBSREDIAL is done repeatedly if the first attempt to connect to a BBS
- ;fails and the user elects to redial. Once a connection is made, control
- ;passes to BBSCONNECT. Note LABEL1 -- it is the beginning of the loop,
- ;so that the CLEAR above it will be executed only once.
-
- BBSREDIAL:
- CLEAR ;Clear the screen -- only done once
- LABEL1: ;Beginning of redial loop
- TRANSMIT "A/!" ;Hayes command for "repeat last command"
- RGET S8 80 40 ;Wait a maximum of 40 seconds to get first <CR> back
- RGET S8 ;Get string from modem
- FIND S8 "CONNECT" ;Look for "CONNECT" in modem string
- IF FOUND ;If "CONNECT" is found in S8 . . .
- GOTO BBSCONNECT ;BBS has been connected -- go to BBSCONNECT
- ENDIF
- GOTO LABEL1 ;Otherwise, loop to LABEL1
-
-
- ;BBSCONNECT is performed once the BBS has been connected with. The main
- ;purpose here is to reset the parity and databits, since they were set to
- ;even and 7 for communication with Telenet. Also, if a dialing directory
- ;entry was used that has a linked command file, BBSCONNECT will execute it.
- ;If you are going to communicate with a BBS or other computer that works
- ;at anything other than 8,N,1, then you should either customize this
- ;subroutine or write a linked command file that changes the parameters.
-
- BBSCONNECT:
- SET PARITY NONE ;Reset parameters . . .
- SET DATABITS 8 ;For use with BBSs
- ALARM 2 ;Inform user of connection
- SWITCH S7 ;Decision based on S7 (BBS command file)
- CASE "_NULL" ;If S7 is empty (no linked command file) . . .
- MLOAD "PROCOMM.KEY" ;Reload PROCOMM.KEY
- EXIT ;Then exit
- ENDCASE
- DEFAULT ;Otherwise . . .
- EXECUTE S7 ;Perform the linked command file
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
- ;PCPOFF is used to disconnect from PCP entirely. It must first determine
- ;the current PCP level, i. e., connected to a remote city, connected to
- ;local Telenet only, etc. This will be the value of S0. Then, the
- ;appropriate subroutines are performed. Finally, VERSA itself will
- ;terminate.
-
- PCPOFF:
- CLEAR ;Clear the screen
- IF NOT CONNECTED ;If PCP has disconnected . . .
- GOTO VERSAOFF ;Go directly to VERSAOFF
- ENDIF
- SWITCH S0 ;Decision based on S0 (level information)
- CASE "1" ;If S0 = "1" (offline), no disconnection needed . . .
- GOTO VERSAOFF ;Just go to VERSAOFF (terminate VERSA)
- ENDCASE
- CASE "2" ;If S0 = "2" (Local Telenet level) . . .
- GOTO DISC2 ;Disconnect from level 2; VERSAOFF will follow
- ENDCASE
- CASE "3" ;If S0 = "3" (Remote city level) . . .
- GOSUB DISC3 ;Disconnect from level 3 . . .
- GOTO DISC2 ;Disconnect from level 2; VERSAOFF will follow
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
- ;DISC3 (disconnect from level 3) is a true subroutine. It is performed to
- ;disconnect from a remote city, sending the user back to the local Telenet
- ;level, whenever this is required. DISC3 assumes that Telenet has been set
- ;to look for a BREAK as the command to return to the Telenet prompt, but
- ;will try <CR>@<CR> if that doesn't work.
-
- DISC3:
- CLEAR ;Clear the screen
- MESSAGE "Disconnecting from remote city . . ."
- BREAK 10 ;Send a BREAK, 10 ms, to return to Telenet prompt
- WAITFOR "@" 5 ;Wait for Telenet prompt
- TRANSMIT "!" ;Get fresh prompt, in case of garbage characters
- IF NOT WAITFOR ;If that didn't work . . .
- TRANSMIT "!@!" ;Transmit <CR>@<CR> to return to Telenet prompt
- ENDIF
- WAITFOR "@" 5 ;Wait for appearance of Telenet prompt
- TRANSMIT "D!" ;Transmit D<CR>; disconnect command
- WAITFOR "@" 5 ;Wait for next Telenet prompt
- MESSAGE "^M^J^M^J" ;Send CR/LFs, in case of DISC2 messages following
- PAUSE 1 ;Allow user to see results
- ASSIGN S0 "2" ;Level is now 2 (local Telenet level)
- RETURN ;RETURN to caller
-
-
- ;DISC2 (disconnect from level 2) is used to disconnect from the local
- ;Telenet level, thereby putting the user's modem offline. It is assumed
- ;that the user must also be finished with VERSA, so DISC2 always "falls
- ;through" to VERSAOFF.
-
- DISC2:
- MESSAGE "Disconnecting from local Telenet . . .^M^J"
- TRANSMIT "HANGUP!" ;Disconnect from Telenet command
- PAUSE 1 ;Causes "garbage" character to go behind HANGUP
- MESSAGE "^M^J" ;CR/LF sent to make next message further down
-
-
- ;VERSAOFF is very simple. Whenever VERSA terminates itself, this is the
- ;last subroutine executed (except when a BBS has been connected). So, if
- ;there is something that you would like to have done every time VERSA ends
- ;normally, place the commands here. VERSAOFF reloads PROCOMM.KEY, since
- ;VERSA.KEY was loaded for use while VERSA was executing.
-
- VERSAOFF:
- MLOAD "PROCOMM.KEY" ;Reload PROCOMM.KEY
- MESSAGE "VERSA finished." ;Inform the user
- EXIT ;End the command file
-
-
- ;NETREDIAL is used to redial the Net Exchange, if the user selected it from
- ;The City Menu and it was busy. Once NETREDIAL connects with the Net
- ;Exchange, control is passed to BBSCONNECT.
-
- NETREDIAL:
- CLEAR ;Clear the screen
- TRANSMIT "C PURSUIT," ;Beginning of Net Exchange dial command
- MACRO 9 ;Transmit user ID
- WAITFOR "=" ;Wait for "PASSWORD ="
- MACRO 0 ;Transmit password
- RGET S8 ;Get first <CR>
- RGET S8 ;Get second <CR>
- RGET S8 ;Get message
- FIND S8 "CONNECTED" ;Look for "CONNECTED" in S8
- IF FOUND ;If it is found . . .
- GOTO BBSCONNECT ;Go to BBSCONNECT
- ENDIF
- GOTO NETREDIAL ;Otherwise, loop for another redial
-
-
- ;NETDIAL is used to dial the Net Exchange, with the C PURSUIT command. If
- ;a redial is requested, NETDIAL will branch to NETREDIAL. If the Net
- ;Exchange is connected with, NETDIAL will branch to BBSCONNECT.
-
- NETDIAL:
- TRANSMIT "C PURSUIT," ;Beginning of PURSUIT command
- MACRO 9 ;Transmit user ID
- WAITFOR "=" ;Wait for "PASSWORD ="
- MACRO 0 ;Transmit password
- RGET S8 ;Get first <CR>
- RGET S8 ;Get second <CR>
- RGET S8 ;Get message
- FIND S8 "CONNECTED" ;Look for "CONNECTED" in S8
- IF FOUND ;If it's there,
- GOTO BBSCONNECT ;Go to BBSCONNECT
- ENDIF
- CLEAR ;Otherwise, clear the screen
- LOCATE 11,16 ;Locate cursor for message
- MESSAGE "The Net Exchange is busy. Begin redial <Y/N>?"
- LABEL2: ;Loop to here in case of erroneous input
- LOCATE 11,63 ;Locate cursor for user input
- GET S9 1 ;Get user input (1 character)
- SWITCH S9 ;Decision based on user input
- CASE "Y" ;If the user entered "Y" . . .
- GOTO NETREDIAL ;Begin redialing
- ENDCASE
- CASE "N" ;If the user entered "N" . . .
- GOTO CITYCHOICE ;Another city must be selected
- ENDCASE
- CASE "D" ;If the user entered "D" . . .
- GOTO PCPOFF ;PCPOFF will take care of the disconnection
- ENDCASE
- CASE "E" ;If the user entered "E" . . .
- CLEAR ;Clear the screen
- GOTO VERSAOFF ;Exit VERSA
- ENDCASE
- DEFAULT ;Anything else is erroneous input
- MESSAGE "^G" ;Beep at the user
- LOCATE 11,63 ;Locate cursor
- MESSAGE " " ;Erase erroneous input
- GOTO LABEL2 ;Redo the GET
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== TITLE ==========
- ;This is the real beginning of the command file. This is the first thing
- ;done after the defaults are set in BEGIN. TITLE displays the "credits"
- ;and then determines the current PCP level (modem offline, local Telenet
- ;level, or remote city level.) Once the level has been determined, it is
- ;stored in S0 as a 1, 2, or 3, respectively.
-
- TITLE:
- CLEAR ;Clear the screen
- LOCATE 2,0 ;Locate the cursor for credit drawing
- MESSAGE " ╔═══════════════════════════════╗"
- MESSAGE " ║ ║"
- MESSAGE " ║ PC Pursuit: VERSAdial ║"
- MESSAGE " ║ Written by Allen Brunson, ║"
- MESSAGE " ║ David Rhoten, and Gizmo ║"
- MESSAGE " ║ ║"
- MESSAGE " ║ `"D`" - Disconnect ║"
- MESSAGE " ║ `"E`" - Exit VERSA ║"
- MESSAGE " ║ ║"
- MESSAGE " ╚═══════════════════════════════╝"
- LOCATE 14,0 ;Locate the cursor for next message
- MESSAGE "Determining PC Pursuit level . . .^M^J"
- IF NOT CONNECTED ;If local modem is offline . . .
- MESSAGE "Modem is currently offline."
- ASSIGN S0 "1" ;Then the level is 1
- PAUSE 1 ;Allow user to see message
- GOTO CITYCHOICE ;Go to city selection
- ENDIF
- TRANSMIT "ATZ!" ;Test for a remote modem
- RGET S8 80 3 ;Get first <CR>
- RGET S8 80 3 ;This is where "?" will come back, if local Telenet
- RGET S9 80 3 ;This is where "OK" will come back, if remote city
- FIND S8 "?" ;Look for "?" in S8
- IF FOUND ;If "?" is found in S8, at local Telenet . . .
- MESSAGE "^M^JLocal Telenet level determined."
- ASSIGN S0 "2" ;Therefore, the level is 2
- PAUSE 1 ;Allow user to see message
- GOTO CITYCHOICE ;Go to city selection
- ENDIF
- FIND S9 "OK" ;Look for "OK" in S9
- IF FOUND ;If "OK" is found in S9, must be remote level . . .
- MESSAGE "^M^JRemote city level determined."
- ASSIGN S0 "3" ;Therefore, the level is 3
- PAUSE 1 ;Allow user to see message
- GOTO MENUCHECK ;User must select a BBS to dial
- ENDIF
- FIND S9 "MANUAL ANSWER" ;Look for R/V mode response
- IF FOUND ;If modem is in R/V mode,
- TRANSMIT "!" ;Transmit a <CR>
- PAUSE 1 ;Wait
- TRANSMIT "!" ;Transmit another <CR>
- WAITFOR "*" 10 ;Wait for R/V prompt
- TRANSMIT "I!" ;Return to Hayes mode
- WAITFOR "IDLE" ;Wait for confirmation
- TRANSMIT "ATZ!" ;Reset in Hayes mode
- WAITFOR "OK" ;Wait for "OK"
- MESSAGE "^M^JRemote city level determined."
- ASSIGN S0 "3" ;Level is now 3
- PAUSE 1 ;Allow user to see message
- GOTO MENUCHECK ;User must select a BBS to dial
- ENDIF ;If none of that worked . . .
- MESSAGE "^M^JUnable to determine level.^M^J"
- GOTO VERSAOFF ;Something is fishy, VERSA will not proceed
-
-
-
- ;========== CITYCHOICE ==========
- ;This routine is used to get the area code that the user wishes to call.
- ;(Or, to allow the user to directly dial the Net Exchange.) If necessary,
- ;this routine will call CITYMENU to print a menu of selections. (The
- ;decision to draw the menu or not is based on the value of S6, and whether
- ;or not the user requests it by entering "M".) When CITYCHOICE is
- ;finished, it will "fall through" to MENUCHECK.
-
- CITYCHOICE:
- FIND S6 "OFF" ;Look for "OFF" in S6 (menu choice)
- IF NOT FOUND ;If menus are set "ON",
- GOTO CITYMENU ;Draw CITYMENU
- ENDIF
- CLEAR ;Otherwise, clear the screen
- LOCATE 10,26 ;Locate cursor for first message
- MESSAGE "Enter desired area code:"
- LOCATE 12,29 ;Locate cursor for second message
- MESSAGE "Options: 1-26, M"
- LOCATE 10,51 ;Locate cursor for user input
- GET S9 3 ;Get user input (3 characters)
- LABEL3: ;If called, CITYMENU returns to here
- SWITCH S9 ;Decision based on user input
- CASE "1"
- ASSIGN S1 "404" ;Cases 1 through 26 are more or less
- ENDCASE ;the same (except 6). Each assigns
- CASE "2" ;an area code to S1, depending on which
- ASSIGN S1 "617" ;number the user entered. Number 6 is
- ENDCASE ;different, because it uses the direct
- CASE "3" ;C PURSUIT command.
- ASSIGN S1 "216"
- ENDCASE
- CASE "4"
- ASSIGN S1 "313"
- ENDCASE
- CASE "5"
- ASSIGN S1 "305"
- ENDCASE
- CASE "6" ;If user selects the Net Exchange . . .
- ASSIGN S1 "NET" ;Assign "NET" to S1
- ;ASSIGN S7 "COMMAND.VER" ;Command file to execute upon connect
- GOTO GOLEVEL ;Begin dialing at GOLEVEL
- ENDCASE
- CASE "7"
- ASSIGN S1 "201"
- ENDCASE
- CASE "8"
- ASSIGN S1 "212"
- ENDCASE
- CASE "9"
- ASSIGN S1 "215"
- ENDCASE
- CASE "10"
- ASSIGN S1 "919"
- ENDCASE
- CASE "11"
- ASSIGN S1 "813"
- ENDCASE
- CASE "12"
- ASSIGN S1 "202"
- ENDCASE
- CASE "13"
- ASSIGN S1 "312"
- ENDCASE
- CASE "14"
- ASSIGN S1 "214"
- ENDCASE
- CASE "15"
- ASSIGN S1 "713"
- ENDCASE
- CASE "16"
- ASSIGN S1 "414"
- ENDCASE
- CASE "17"
- ASSIGN S1 "612"
- ENDCASE
- CASE "18"
- ASSIGN S1 "303"
- ENDCASE
- CASE "19"
- ASSIGN S1 "602"
- ENDCASE
- CASE "20"
- ASSIGN S1 "801"
- ENDCASE
- CASE "21"
- ASSIGN S1 "818"
- ENDCASE
- CASE "22"
- ASSIGN S1 "213"
- ENDCASE
- CASE "23"
- ASSIGN S1 "503"
- ENDCASE
- CASE "24"
- ASSIGN S1 "415"
- ENDCASE
- CASE "25"
- ASSIGN S1 "408"
- ENDCASE
- CASE "26"
- ASSIGN S1 "206"
- ENDCASE
- CASE "D" ;If the user enters "D" . . .
- GOTO PCPOFF ;Then PCPOFF will take care of disconnection
- ENDCASE
- CASE "E" ;If user enters "E" . . .
- CLEAR ;Clear the screen . . .
- GOTO VERSAOFF ;And exit
- ENDCASE
- CASE "M" ;If user enters "M" . . .
- GOTO CITYMENU ;Draw CITYMENU (which will return to LABEL3)
- ENDCASE
- DEFAULT ;Any other input should be an area code . . .
- ASSIGN S1 S9 ;So assign it to S1
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== MENUCHECK ==========
- ;This code segment decides whether the VERSA?.MNU files should be called,
- ;or if the built-in 20 number dialer should be used instead. The
- ;decision is based on the value the user entered for S6 in the BEGIN code
- ;segment. If the area code variable is null, which happens on remote city
- ;level starts, then MENUCHECK gives the user the opportunity to enter the
- ;area code, and then be able to use the VERSA?.MNU files. (This of course
- ;only happens if the user has the extended menus set ON.) If the current
- ;area code is unknown to VERSA, MENUCHECK will "fall through" to BBSMENU.
-
- MENUCHECK:
- FIND S6 "OFF" ;Look for "OFF" in S6
- IF FOUND ;If found (menus set off),
- GOTO BBSCHOICE ;Go to BBSCHOICE
- ENDIF ;Otherwise . . .
- SWITCH S1 ;Decision based on selected area code
- CASE "404"
- EXECUTE "VERSA1.MNU" ;Cases 1 through 25 are more or less the
- ENDCASE ;same. Each executes the correct MENU file
- CASE "617" ;that that city's menu can be found in.
- EXECUTE "VERSA1.MNU"
- ENDCASE
- CASE "216"
- EXECUTE "VERSA1.MNU"
- ENDCASE
- CASE "313"
- EXECUTE "VERSA1.MNU"
- ENDCASE
- CASE "305"
- EXECUTE "VERSA1.MNU"
- ENDCASE
- CASE "201"
- EXECUTE "VERSA1.MNU"
- ENDCASE
- CASE "212"
- EXECUTE "VERSA2.MNU"
- ENDCASE
- CASE "215"
- EXECUTE "VERSA2.MNU"
- ENDCASE
- CASE "919"
- EXECUTE "VERSA2.MNU"
- ENDCASE
- CASE "813"
- EXECUTE "VERSA2.MNU"
- ENDCASE
- CASE "202"
- EXECUTE "VERSA2.MNU"
- ENDCASE
- CASE "312"
- EXECUTE "VERSA2.MNU"
- ENDCASE
- CASE "214"
- EXECUTE "VERSA3.MNU"
- ENDCASE
- CASE "713"
- EXECUTE "VERSA3.MNU"
- ENDCASE
- CASE "414"
- EXECUTE "VERSA3.MNU"
- ENDCASE
- CASE "612"
- EXECUTE "VERSA3.MNU"
- ENDCASE
- CASE "303"
- EXECUTE "VERSA3.MNU"
- ENDCASE
- CASE "602"
- EXECUTE "VERSA3.MNU"
- ENDCASE
- CASE "801"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "818"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "213"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "503"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "415"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "408"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "206"
- EXECUTE "VERSA4.MNU"
- ENDCASE
- CASE "_NULL" ;If area code variable is null . . .
- CLEAR ;Clear the screen
- LOCATE 11,18 ;Locate cursor for message
- MESSAGE "Enter area code, or <Return> if unknown:"
- LOCATE 11,59 ;Locate cursor for user input
- GET S9 3 ;Get user input (3 characters)
- SWITCH S9 ;Decision based on user input
- CASE "_NULL" ;If user entered nothing . . .
- GOTO BBSMENU ;Use built-in BBS menu
- ENDCASE
- CASE "D" ;If user entered "D" . . .
- GOTO PCPOFF ;Then PCPOFF will take care of disconnection
- ENDCASE
- CASE "E" ;If user entered "E" . . .
- CLEAR ;Clear the screen
- GOTO VERSAOFF ;Exit VERSA
- ENDCASE
- DEFAULT ;Otherwise (user entered area code),
- ASSIGN S1 S9 ;Put the area code in S1
- GOTO MENUCHECK ;Re-execute this code segment
- ENDCASE
- ENDSWITCH ;All possible inputs covered
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== BBSCHOICE ==========
- ;After the user has entered an area code, BBSCHOICE prompts the user for a
- ;number to dial (if the extended menus are not used). Also, if a command
- ;file is used with a dialing entry, it is assigned to S7. An additional
- ;choice is also offered: "G", or Go back to city selection. As always, "D"
- ;and "E" are valid selections. Once BBSCHOICE is finished, it usually
- ;"falls through" to GOLEVEL, depending on user input.
-
- BBSCHOICE:
- FIND S6 "OFF" ;Look for "OFF" in S6 (menu selection)
- IF NOT FOUND ;If not found (menus set on),
- GOTO BBSMENU ;draw BBSMENU (this is needed in case that
- ENDIF ;MENUCHECK "fell through" to here)
- CLEAR ;Otherwise, clear the screen
- LOCATE 10,23 ;Locate the cursor for first message
- MESSAGE "Enter phone number of BBS:"
- LOCATE 12,26 ;Locate the cursor for second message
- MESSAGE "Options: 1-20, G, M"
- LOCATE 10,50 ;Locate the cursor for user input
- GET S9 7 ;Get user input (7 characters)
- LABEL4: ;If BBSMENU is called, it will return to here
- SWITCH S9 ;Decision based on user input
- CASE "1"
- ASSIGN S2 "4330062" ;Cases 1-20 are all identical. Each
- ;ASSIGN S7 "COMMAND.VER" ;assigns the number of a BBS to S2, and
- ENDCASE ;assigns a command file to S7 to be
- CASE "2" ;executed once that BBS connects. The
- ASSIGN S2 "2373750" ;command file is optional, and may be
- ;ASSIGN S7 "COMMAND.VER" ;omitted entirely.
- ENDCASE
- CASE "3"
- ASSIGN S2 "9942944"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "4"
- ASSIGN S2 "3496576"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "5"
- ASSIGN S2 "9645160"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "6"
- ASSIGN S2 "7814723"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "7"
- ASSIGN S2 "17184571752"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "8"
- ASSIGN S2 "5243984"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "9"
- ASSIGN S2 "8482106"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "10"
- ASSIGN S2 "4311194"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "11"
- ASSIGN S2 "6893561"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "12"
- ASSIGN S2 "6960360"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "13"
- ASSIGN S2 "3813320"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "14"
- ASSIGN S2 "5767285"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "15"
- ASSIGN S2 "9363058"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "16"
- ASSIGN S2 "8824227"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "17"
- ASSIGN S2 "7295377"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "18"
- ASSIGN S2 "XXXXXXX"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "19"
- ASSIGN S2 "XXXXXXX"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "20"
- ASSIGN S2 "XXXXXXX"
- ;ASSIGN S7 "COMMAND.VER"
- ENDCASE
- CASE "D" ;If the user enters "D" . . .
- GOTO PCPOFF ;Then PCPOFF will take care of disconnection
- ENDCASE
- CASE "E" ;If the user enters "E" . . .
- CLEAR ;Clear the screen . . .
- GOTO VERSAOFF ;And exit
- ENDCASE
- CASE "G" ;User wants to go back to city selection
- FIND S0 "3" ;Check if the level is 3 (remote city)
- IF FOUND ;If it is . . .
- GOSUB DISC3 ;Then disconnect from remote city
- ENDIF
- GOTO CITYCHOICE ;Get new area code
- ENDCASE
- CASE "M" ;If user enters "M" . . .
- GOTO BBSMENU ;Draw the BBSMENU (will return to LABEL4)
- ENDCASE
- DEFAULT ;Any other input should be a phone number
- ASSIGN S2 S9 ;So assign it to S2
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== GOLEVEL ==========
- ;After the area code and phone number have been safely stored away, it's time
- ;to get on with the dialing. GOLEVEL directs execution to the correct area,
- ;based on the value of S0. (TITLE or another routine will have previously
- ;stored the level information in S0.)
-
- GOLEVEL:
- SWITCH S0 ;Decision based on S0 (level information)
- CASE "1" ;If S0 = "1" (Modem offline) . . .
- GOTO LEVEL1 ;Start dialing at LEVEL1
- ENDCASE
- CASE "2" ;If S0 = "2" (Local Telenet) . . .
- CLEAR ;Clear the screen (LEVEL2 does not do this)
- GOTO LEVEL2 ;Start dialing at LEVEL2
- ENDCASE
- CASE "3" ;If S0 = "3" (Remote city) . . .
- CLEAR ;Clear the screen (LEVEL3 does not do this)
- GOTO LEVEL3 ;Start dialing at LEVEL3
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== LEVEL1 ==========
- ;This level of dialing is performed if the modem is offline when VERSA is
- ;started. The dialing command resets the escape character of your modem
- ;to "*" so that it is different than the escape character of the remote
- ;PCP modems. This section assumes that your modem will send the word
- ;"CONNECT" to your computer once it is online to Telenet. If your modem
- ;does not do this, you will have to alter this section. LEVEL1 "falls
- ;through" to LEVEL2 when it is finished.
-
- LEVEL1:
- CLEAR ;Clear the screen
- TRANSMIT "AT S2=42 DT " ;Command to dial local modem, reset escape char
- MACRO 7 ;Local Telenet phone number
- WAITFOR "CONNECT" 20 ;Wait 20 seconds for modem to send "CONNECT"
- IF NOT WAITFOR ;If modem does NOT connect . . .
- HANGUP ;Hang up the phone
- CLEAR ;Clear the screen
- LOCATE 11,19 ;Locate the cursor for message
- MESSAGE "Local Telenet did not connect. Redialing."
- LOCATE 0,0 ;Locate cursor out of the way
- PAUSE 1 ;Allow user to see message
- GOTO LEVEL1 ;Loop to beginning to dial again
- ENDIF ;When Local Telenet is connected with . . .
- PAUSE 2 ;Wait for connection to be properly made
- TRANSMIT "^M^M" ;Send two <CR>s to wake up Telenet
- WAITFOR "=" ;Wait for "TERMINAL TYPE =" prompt
- TRANSMIT "D1!" ;Terminal type D1 is for PCs
- WAITFOR "@" ;Wait for Telenet prompt
-
-
-
- ;========== LEVEL2 ==========
- ;This level of dialing is performed once connection to local Telenet has
- ;been made. This routine checks to make sure that Telenet is still connected
- ;before proceeding. Note that LEVEL2 will go to PORTSET if it connects, or
- ;to CITYREDIAL if the city is busy and the user elects to redial.
-
- LEVEL2:
- IF NOT CONNECTED ;If Telenet has dropped carrier . . .
- CLEAR ;Clear the screen
- LOCATE 11,7 ;Locate the cursor for message
- MESSAGE "Telenet has disconnected. Dialing will begin at the local level."
- LOCATE 0,0 ;Locate the cursor out of the way
- PAUSE 1 ;Allow user to see the message
- ASSIGN S0 "1" ;Level is now 1
- GOTO GOLEVEL ;Start dialing over again
- ENDIF
- ASSIGN S0 "2" ;Otherwise, level is now 2
- FIND S1 "NET" ;Check to see if user is calling the Net Exchange
- IF FOUND ;If so . . .
- GOTO NETDIAL ;Go to NETDIAL
- ENDIF
- TRANSMIT "C DIAL" ;Otherwise: beginning of city dial command
- TRANSMIT S1 ;Area code to be dialed
- MACRO 8 ;PCP baud rate
- MACRO 9 ;User ID
- WAITFOR "=" ;Wait for "PASSWORD ="
- MACRO 0 ;User password
- RGET S8 ;Get first <CR>
- RGET S8 ;Get second <CR>
- RGET S8 ;Get message
- FIND S8 "CONNECTED" ;Look for "CONNECTED" in S8
- IF FOUND ;If "CONNECTED" is in S8 . . .
- MESSAGE "^G" ;Sound the bell, because . . .
- GOTO PORTSET ;City has been connected -- go to PORTSET
- ENDIF
- CLEAR ;Otherwise, clear the screen . . .
- LOCATE 11,11 ;Locate cursor for message
- MESSAGE "No modems available in remote city. Begin redial <Y/N>?"
- LABEL5: ;Loop to here in case of erroneous input
- LOCATE 11,68 ;Locate cursor for user input
- GET S9 1 ;Get user input (1 character)
- SWITCH S9 ;Decision based on user input
- CASE "Y" ;If user enters "Y" . . .
- GOTO CITYREDIAL ;Redial the city
- ENDCASE
- CASE "N" ;If user enters "N" . . .
- GOTO CITYCHOICE ;Another city must be selected
- ENDCASE
- CASE "D" ;If user enters "D" . . .
- GOTO PCPOFF ;PCPOFF will take care of the disconnection
- ENDCASE
- CASE "E" ;If user enters "E" . . .
- CLEAR ;Clear the screen . . .
- GOTO VERSAOFF ;Exit VERSA
- ENDCASE
- DEFAULT ;If user enters anything else . . .
- MESSAGE "^G" ;Beep at him or her
- LOCATE 11,68 ;Locate the cursor
- MESSAGE " " ;Erase the erroneous input
- GOTO LABEL5 ;Redo the GET
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== PORTSET ==========
- ;PORTSET is done the first time a city is connected with, to set up some
- ;special port parameters. The 1:0 part disables the <CR>@<CR> escape to
- ;Telenet, the 4:2 changes the "packet delay" to .1 second, and the 7:8 part
- ;enables a break signal for returning to Telenet. If there are other SET
- ;commands that you know of and would like to use, you can place them in the
- ;TRANSMIT string along with the others. Once PORTSET is finished, it will
- ;"fall through" to LEVEL3.
-
- PORTSET:
- TRANSMIT "!@!" ;Get back to Telenet prompt
- WAITFOR "@" ;When it appears,
- TRANSMIT "SET? 1:0,4:2,7:8!" ;Do the SETs
- WAITFOR "@" 3 ;Wait for the prompt again
- TRANSMIT "CONT!" ;Get back to Hayes mode
-
-
-
- ;========== LEVEL3 ==========
- ;This dialing is done once a remote city has been connected with (usually
- ;after the SETs have been done). Like LEVEL2, this routine checks to make
- ;sure that Telenet is still connected before proceeding.
-
- LEVEL3:
- IF NOT CONNECTED ;If Telenet has dropped carrier . . .
- CLEAR ;Clear the screen
- SWITCH S1 ;Decision based on S1 (area code)
- CASE "_NULL" ;If the area code is unknown . . .
- LOCATE 11,16 ;Locate cursor for message
- MESSAGE "Telenet has disconnected. Area code is unknown."
- LOCATE 0,0 ;Locate cursor out of the way
- PAUSE 1 ;Allow user to see message
- ASSIGN S0 "1" ;Level is now 1
- GOTO CITYCHOICE ;Start over from area code selection
- ENDCASE
- DEFAULT ;If the area code is known . . .
- LOCATE 11,7 ;Locate cursor for message
- MESSAGE "Telenet has disconnected. Dialing will begin at the local level."
- LOCATE 0,0 ;Locate cursor out of the way
- PAUSE 1 ;Allow user to see message
- ASSIGN S0 "1" ;Level is now 1
- GOTO LEVEL1 ;Start dialing
- ENDCASE
- ENDSWITCH ;All possibilities covered
- ENDIF ;End of IF NOT CONNECTED routine
- ASSIGN S0 "3" ;Otherwise, level is now 3
- TRANSMIT "ATZ!" ;Reset remote modem
- RGET S8 80 3 ;Get first <CR>
- RGET S8 80 3 ;Get second <CR>
- RGET S8 80 3 ;Get actual message
- FIND S8 "OK" ;Look for "OK" in S8
- IF NOT FOUND ;If no "OK" is found, assume R/V mode . . .
- PAUSE 1 ;Necessary in case of "INVALID COMMAND" response
- TRANSMIT "!" ;Transmit <CR>
- PAUSE 1 ;Wait
- TRANSMIT "!" ;Transmit another <CR>
- WAITFOR "*" 5 ;Wait for R/V prompt
- TRANSMIT "I!" ;Transmit command to exit R/V mode
- WAITFOR "IDLE" 5 ;Wait for confirmation
- TRANSMIT "ATZ!" ;Reset in Hayes mode
- WAITFOR "OK" ;Wait for "OK"
- ENDIF ;End of R/V routine
- TRANSMIT "ATDT " ;Beginning of Hayes dialing command
- TRANSMIT S2 ;Telephone number to dial
- TRANSMIT "!" ;<CR> to complete command
- RGET S8 ;Get first <CR>
- RGET S8 80 50 ;Wait a maximum of 50 seconds for second <CR>
- RGET S8 ;Get real message
- FIND S8 "CONNECT" ;Find "CONNECT" in S8
- IF FOUND ;If "CONNECT" is found in S8 . . .
- GOTO BBSCONNECT ;BBS has been connected, go to BBSCONNECT
- ENDIF
- CLEAR ;Otherwise, clear the screen . . .
- LOCATE 11,20 ;Locate the cursor for message
- MESSAGE "The BBS is busy. Begin redial <Y/N>?"
- LABEL6: ;Loop to here in case of erroneous input
- LOCATE 11,58 ;Locate the cursor for user input
- GET S9 1 ;Get user input (1 character)
- SWITCH S9 ;Decision based on user input
- CASE "Y" ;If the user enters "Y" . . .
- GOTO BBSREDIAL ;Redial the BBS
- ENDCASE
- CASE "N" ;If user enters "N" . . .
- GOTO MENUCHECK ;User must select another BBS to dial
- ENDCASE
- CASE "D" ;If user enters "D" . . .
- GOTO PCPOFF ;PCPOFF will take care of the disconnection
- ENDCASE
- CASE "E" ;If user enters "E" . . .
- CLEAR ;Clear the screen . . .
- GOTO VERSAOFF ;Exit VERSA
- ENDCASE
- DEFAULT ;If the user enters anything else . . .
- MESSAGE "^G" ;Beep at him or her
- LOCATE 11,58 ;Locate the cursor
- MESSAGE " " ;Erase the erroneous input
- GOTO LABEL6 ;Redo the GET
- ENDCASE
- ENDSWITCH ;All possibilities covered
-
-
-
- ;========== CITYMENU ==========
- ;This CITYMENU is drawn if the user selects option "M" when asked for an area
- ;code to dial, or if the S6 variable is set to "ON" (extended menus). The
- ;only reason to not display the menu is because it takes a while to draw,
- ;which slows down the program. In addition to drawing the menu, this section
- ;relocates the cursor to the correct position in the menu, then gets the
- ;user's input. It then returns to LABEL3 in CITYCHOICE.
-
- CITYMENU:
- CLEAR ;Clear screen for menu drawing
- MESS" ╒════════════════════╡ PC Pursuit City Menu ╞════════════════════╕"
- MESS" │ │"
- MESS" │ E < 1> Atlanta (404) C <14> Dallas (214) │"
- MESS" │ E < 2> Boston (617) C <15> Houston (713) │"
- MESS" │ E < 3> Cleveland (216) C <16> Milwaukee (414) │"
- MESS" │ E < 4> Detroit (313) M <17> Minneapolis (612) │"
- MESS" │ E < 5> Miami (305) M <18> Denver (303) │"
- MESS" │ E < 6> Net Exchange (n/a) M <19> Phoenix (602) │"
- MESS" │ E < 7> Newark (201) P <20> Salt Lake City (801) │"
- MESS" │ E < 8> New York (212) P <21> Glendale (818) │"
- MESS" │ E < 9> Philadelphia (215) P <22> Los Angeles (213) │"
- MESS" │ E <10> Res. Tri. Park (919) P <23> Portland (503) │"
- MESS" │ E <11> Tampa (813) P <24> San Francisco (415) │"
- MESS" │ E <12> Washington D.C. (202) P <25> San Jose (408) │"
- MESS" │ C <13> Chicago (312) P <26> Seattle (206) │"
- MESS" │ │"
- MESS" │ E - Eastern Time C - Central Time │"
- MESS" │ M - Mountain Time P - Pacific Time │"
- MESS" │ │"
- MESS" ├────────────────────────────────────────────────────────────────┤"
- MESS" │ Enter area code or number of desired city: │"
- MESS" ╘════════════════════════════════════════════════════════════════╛
- LOCATE 20,60 ;Locate cursor for user input
- GET S9 3 ;Get user input (3 characters)
- GOTO LABEL3 ;Return to CITYCHOICE
-
-
-
- ;========== BBSMENU ==========
- ;This menu is identical in function to CITYMENU, only it is used for your
- ;most frequently dialed BBS's. And, like CITYMENU, this menu is not
- ;displayed unless the user requests it by entering "M" or leaving S6 set to
- ;"ON", because it takes a while to draw, which slows down execution. Once
- ;the menu is drawn, the selected area code is printed in the menu to help
- ;the user keep from selecting a BBS that is not in the selected city. (If
- ;VERSA is started at the remote level, VERSA will not know the selected
- ;area code, and "???" will be printed instead.) Finally, the cursor is
- ;located inside the menu, the user's input is accepted, and control is
- ;returned to LABEL4 in BBSCHOICE.
-
- BBSMENU:
- CLEAR ;Clear the screen for menu drawing
- LOCATE 2,0 ;Locate the cursor for menu drawing
- MESS" ╒═══════════════════╡ All Cities BBS Directory ╞═══════════════════╕"
- MESS" │ │"
- MESS" │ < 1> Atlanta PC UG (404) <11> The Net Exchange (703) │"
- MESS" │ < 2> Boston Comp. Soc. (617) <12> PC Magazine IRS (212) │"
- MESS" │ < 3> Vernon Buerg's BBS (415) <13> PC Ohio (216) │"
- MESS" │ < 4> Charisma (415) <14> PC Tech Journal BBS (202) │"
- MESS" │ < 5> Exec PC (414) <15> Phoenix Techline (612) │"
- MESS" │ < 6> Friends!! (212) <16> Plantz's Superboard (312) │"
- MESS" │ < 7> Friends, Too!! (212) <17> Sparta (201) │"
- MESS" │ < 8> Gannett Help Screen (202) <18> ( ) │"
- MESS" │ < 9> Interconnect (202) <19> ( ) │"
- MESS" │ <10> Invention Factory (212) <20> ( ) │"
- MESS" │ │"
- MESS" │ Selected area code: │"
- MESS" │ <G>o back to city selection │"
- MESS" │ │"
- MESS" ├───────────────────────────────────────────────────────────────────┤"
- MESS" │ Enter selection 1-20 or other BBS phone number: │"
- MESS" ╘═══════════════════════════════════════════════════════════════════╛"
- LOCATE 15,48 ;Locate cursor for area code printing
- SWITCH S1 ;Decision based on S1 (area code variable)
- CASE "_NULL" ;If S1 is empty . . . │This occurs when VERSA is
- MESSAGE "???" ;Unknown area code │started at the remote level
- ENDCASE
- DEFAULT ;Otherwise . . .
- MESSAGE S1 ;Print the selected area code
- ENDCASE
- ENDSWITCH ;All possibilities covered
- LOCATE 19,60 ;Locate cursor for user input
- GET S9 7 ;Get user input (7 characters)
- GOTO LABEL4 ;Return to BBSCHOICE